package com.framework.common.exception;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;

import java.io.IOException;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 22:51
 * @since JDK 1.8
 */
@Slf4j
public class RestTemplateEexceptionHandler extends DefaultResponseErrorHandler {

    @Override
    public void handleError(ClientHttpResponse response) throws IOException {
        log.warn("restTemplate调用异常,异常信息=[{}]" + JSON.toJSONString(response));
    }
}
